import request from "@/utils/request";

/**
 * @description 列表
 * @param params
 * @returns {*}
 */
export function list(params){
    return request({
        url:'/business/getBusinessList',
        method:'GET',
        params
    })
}

export function distributionList(params){
    return request({
        url:'/distributionRecords/getDistributionRecordsByBusinessId',
        method:'GET',
        params
    })
}

/**
 * @description 新增/编辑
 * @param data
 * @returns {*}
 */
export function save(data){
    return request({
        url:'/business/addAndUpdateBusiness',
        method:'POST',
        data
    })
}

/**
 * @description 删除
 * @param id
 * @returns {*}
 */
export function deleteRow(id){
    return request({
        url:'/business/delBusiness',
        method:'GET',
        params:{id}
    })
}

/**
 * @description 详情
 * @param id
 * @returns {*}
 */
export function detail(id){
    return request({
        url:'/business/getBusinessById',
        method:'GET',
        params:{id}
    })
}

export function optionsList(){
    return request({
        url:'/common/getAreaList',
        method:'GET'
    })
}
export function optionsList1(){
    return request({
        url:'/common/getCityList',
        method:'GET'
    })
}

/**
 * @description 更新状态
 * @param id
 * @param status
 * @returns {*}
 */
export function updateStatus(id,shelvesStatus){
    return request({
        url:'/integralMall/admin/offCommodity',
        method:'GET',
        params:{id,shelvesStatus}
    })
}

export function getBusinessTypeList(){
    return request({
        url:'/business/getTypeList',
        method:'GET'
    })
}

export function businessGrant(id,voucherAmount,integral){
    return request({
        url:'/business/businessGrant',
        method:'GET',
        params:{id,voucherAmount,integral}
    })
}

export function goodsOrderNews(){
    return request({
        url:'/homepage/goodsOrderNews',
        method:'GET'
    })
}

export function activityOrderNews(){
    return request({
        url:'/homepage/activityOrderNews',
        method:'GET'
    })
}

export function vipNews(){
    return request({
        url:'/homepage/vipNews',
        method:'GET'
    })
}

export function userNews(isVip){
    return request({
        url:'/homepage/userNews',
        method:'GET',
        params:{isVip}
    })
}
export function getUserAllCount(params){
    return request({
        url:'/user/getUserAllCount',
        method:'GET',
        params
    })
}
